/**
 * 实现声音的播放
 * 创建者：Carburn Ashroom
 * 2024.3.5
 */

#include "voice.h"

namespace Voice {

    void beep(Voice_type voice)
    {
        thread th {th_beep,voice};
        th.detach();
    }

    void th_beep(Voice_type voice)
    {
        complex<int> v;
        switch (voice) {
        case Voice_type::insep:
            v = voice_insep;
            break;
        case Voice_type::loose:
            v = voice_loose;
            break;
        case Voice_type::final:
            v = voice_final;
            break;
        }
        Beep(v.real(), v.imag());
    }

}
